* {
    padding: 0;
    margin: 0;
}

html, body {
    width: 100%;
    height: 100%;
    background: url("../images/bj.png");
    background-size: cover;
}

li {
    list-style: none;
}

.box {
    position: relative;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 500px;
    background-color: rgba(0, 0, 0, .9);
    overflow:hidden
}

.snake li {
    position: absolute;
    width: 20px;
    height: 20px;
    top: 0;
    background-color: rgba(255, 255, 0, 1);
}

.snake li:nth-of-type(1) {
    left: 60px;
}

.snake li:nth-of-type(2) {
    left: 40px;
}

.snake li:nth-of-type(3) {
    left: 20px;
}

.food {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: #77ff33;
    top: 0;
    left: 0;
    display: none;
    animation: fade 600ms infinite;
}


.start {
    position: absolute;
    padding: 10px 20px;
    border-radius: 20px;
    background: rgba(255, 255, 0, .8);
    border: 4px solid white;
    font-size: 20px;
    font-weight: 700;
    color: white;
    cursor: pointer;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.start:hover {
    color: red;
}

.end{
    position:absolute;
    background-color: rgba(255,255,255,.8);
    padding:20px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 10px;
    text-align: center;
    font-size: 22px;
    color:white;
    display: none;
}
.end p{
    margin: 20px 0;
    font-size: 34px;
    font-weight: 700;
}
.end span{
    padding:5px 20px;
    background: rgba(255, 255, 0, .8);
    border-radius: 50px;
    border: 4px solid white;
    cursor: pointer;
    font-weight: 700;
}
.end span:hover{
    color: red;
}
@keyframes fade {
    from {
        border-radius: 0;
    }
    50% {
        border-radius: 50%;
    }
    to {
        border-radius: 0;
    }
}


